using Coding4Fun.Phone.Controls;
using MicroMsg.Common.Utils;
using MicroMsg.UI.Page;
using System;
using System.Windows.Controls;
using System.Windows.Media;
namespace MicroMsg.UI.Util
{
	public class MessageBoxManager
	{
		public static ToastPrompt ShowToast(string strToastTitle, int nMiliTime = 2500, Brush backGround = null, bool bIsNeedCutText = false)
		{
			if (backGround == null)
			{
				backGround = R.theme.COMMON_BRUSH;
			}
			ToastPrompt toastPrompt = new ToastPrompt
			{
				Title = strToastTitle,
				MillisecondsUntilHidden = nMiliTime
			};
			if (bIsNeedCutText)
			{
				toastPrompt.TextWrapping = 1;
			}
			else
			{
				toastPrompt.TextWrapping = 2;
			}
			toastPrompt.set_FontSize(18.0);
			toastPrompt.set_Background(backGround);
			toastPrompt.set_Width(480.0);
			Control arg_84_0 = toastPrompt;
			SolidColorBrush solidColorBrush = new SolidColorBrush();
			solidColorBrush.set_Color(Color.FromArgb(255, 255, 255, 255));
			arg_84_0.set_Foreground(solidColorBrush);
			try
			{
				toastPrompt.Show();
			}
			catch (Exception ex)
			{
				Log.smethod_5("MessageBoxManager", "Toast exception catched:" + ex.get_Message());
			}
			return toastPrompt;
		}
	}
}
